#!/bin/bash
# firerule configuration file

# Default variables
DEBUG="NO"		# Print out all debug operation
VERBOSE="YES"		# Print out all iptable operations
SIMULATE="NO"		# Only simulate things. Does not execute
SAVE="NO"		# Produce output in iptables-save format
LOAD="NO"		# Load data from stdin in iptables-save format
INPUT_POLICY="ACCEPT"	# Default INPUT policy
FORWARD_POLICY="DROP"	# Default FORWARD policy
OUTPUT_POLICY="ACCEPT"	# Default OUTPUT policy

# Traffic shaper values
# This is useful in the 'mangle' table to mark packets
MARKPRIO1="1"		# Max Priority - Minimize-Delay
MARKPRIO2="2"		# Medium Priority - Maximize-Throughput
MARKPRIO3="3"		# Low medium Priority
MARKPRIO4="4"		# Low Priority - Minimize-Cost

# Rates
UPRATE="256kbit"	# Maximum bandwidth
#UPRATE="30kbit"		# Maximum bandwidth
DWRATE="800kbit"		# Maximum bandwidth
LOWPROFILERATE="190kbit"	# Low profile bandwidth
PRIORATE1="200kbit"	# Hight Priority bandwidth
PRIORATE2="190kbit"	# Medium Priority bandwidth
PRIORATE3="180kbit"	# Low medium Priority
PRIORATE4="160kbit"	# Low Priority

# Quantum
QUANTUM1="12187"
QUANTUM2="8625"
QUANTUM3="5062"
QUANTUM4="1500"

# Burst
BURST1="6k"
BURST2="4k"
BURST3="2k"
BURST4="0k"
CBURST1="3k"
CBURST2="2k"
CBURST3="1k"
CBURST4="0k"

# Networks definition
# GREEN NETWORK #
# Internal (GREEN) device
GREEN_DEV="eth1"
# Internal (GREEN) ip address
GREEN_IP="192.168.1.1"
# Internal (GREEN) network address
GREEN_NET="192.168.1.0"
# Internal (GREEN) subnet mask
GREEN_MASK="255.255.255.0"

# BRIDGE NETWORK #
# Internal device
BRIDGE_DEV="eth0"
# Internal ip address
BRIDGE_IP="192.168.2.1"
# Internal network address
BRIDGE_NET="192.168.2.0"
# Internal subnet mask
BRIDGE_MASK="255.255.255.0"

# BLUE NETWORK #
# Wi-FI (BLUE) device
BLUE_DEV="wlan0"
# Wi-Fi (BLUE) ip address
BLUE_IP="192.168.50.246"
# Wi-Fi (BLUE) network address
BLUE_NET="192.168.50.240"
# Wi-Fi (BLUE) subnet mask
BLUE_MASK="255.255.255.248"

# RED NETWORK #
# External (RED) device
#RED_DEV="`route -n | grep UG | grep 0.0.0.0 | awk '{print $8}'`"
RED_DEV="ppp0"
# External (RED) ip address
#RED_IP="`ifconfig $REDLAN_DEV | awk FNR==2'{print $2}' | awk -F 'addr:' '{ print $2 }'`"
RED_IP="192.168.1.1"
# External (RED) network address
#RED_NET="`route -n | grep UG | grep 0.0.0.0 | awk '{print $1}'`"
RED_NET="192.168.1.0"
# External (RED) subnet mask
#RED_MASK="`route -n | grep UG | grep 0.0.0.0 | awk '{print $3}'`"
RED_MASK="255.255.255.0"



# This is to make configuration Variables visible outside this script
export DWRATE UPRATE PRIORATE1 PRIORATE2 PRIORATE3 PRIORATE4 QUANTUM1 QUANTUM2 QUANTUM3 QUANTUM4 BURST1 BURST2 BURST3 BURST4  CBURST1 CBURST2 CBURST3 CBURST4 LOWPROFILERATE BRIDGE_DEV BRIDGE_IP BRIDGE_NET BRIDGE_MASK GREEN_DEV GREEN_IP GREEN_NET GREEN_MASK BLUE_DEV BLUE_IP BLUE_NET BLUE_MASK RED_DEV RED_IP RED_NET RED_MASK MARKPRIO1 MARKPRIO2 MARKPRIO3 MARKPRIO4
